package cn.com.yusys.yusp.admin.web.rest;

import cn.com.yusys.yusp.admin.service.ProcessApprovalService;
import cn.com.yusys.yusp.commons.mapper.QueryModel;
import cn.com.yusys.yusp.commons.web.rest.dto.ResultDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api/processApproval")
public class ProcessApprovalResource {

    @Autowired
    ProcessApprovalService processApprovalService;

    @GetMapping("/getApprovalInformation")
    public ResultDto<List<Map<String, Object>>> getApprovalInformation(QueryModel queryModel) {
        return new ResultDto<>(processApprovalService.getApprovalInformation(queryModel));
    }

    @GetMapping("/getApprovalDetail")
    public ResultDto<List<Map<String, Object>>> getApprovalDetail(QueryModel queryModel) {
        return new ResultDto<>(processApprovalService.getApprovalDetail(queryModel));
    }

    @GetMapping("/getMessageDetail")
    public ResultDto<List<Map<String, Object>>> getMessageDetail(QueryModel queryModel) {
        return new ResultDto<>(processApprovalService.getMessageDetail(queryModel));
    }

    @GetMapping("/adoptProcess")
    public ResultDto<String> adoptProcess(QueryModel queryModel) {
        return new ResultDto<>(processApprovalService.adoptProcess(queryModel));
    }

    @GetMapping("/refuseProcess")
    public ResultDto<String> refuseProcess(QueryModel queryModel) {
        return new ResultDto<>(processApprovalService.refuseProcess(queryModel));
    }
}
